package com.gitee.gateway.demo;

import io.vertx.codegen.annotations.GenIgnore;
import io.vertx.codegen.annotations.ProxyClose;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.json.JsonObject;

/**
 * 爬虫接口
 */
@ProxyGen
@VertxGen
public interface DemoService {
    String ADDRESS = "service::demo";
    DeliveryOptions OPTIONS = new DeliveryOptions().setSendTimeout(20000);

    @GenIgnore
    static DemoService create(Vertx vertx, JsonObject config) {
        return new DemoServiceImpl(vertx, config);
    }

    @GenIgnore
    static DemoService createProxy(Vertx vertx) {
        return new DemoServiceVertxEBProxy(vertx, ADDRESS, OPTIONS);
    }

    Future<String> sayHello(String name);

    @ProxyClose
    Future<Void> close();
}